AS=/usr/local/mips-cross/bin/mipsel-elf-as
CC=/usr/local/mips-cross/bin/mipsel-elf-gcc
LD=/usr/local/mips-cross/bin/mipsel-elf-ld
OBJCOPY=/usr/local/mips-cross/bin/mipsel-elf-objcopy
OBJDUMP=/usr/local/mips-cross/bin/mipsel-elf-objdump

all:
	$(AS) -mips1 cachetest.S -o cachetest.o -EL -g
	$(LD) -mips1 -T ../../lib/default.ld cachetest.o -o cachetest.elf -EL -g
	$(OBJCOPY) -j .startup.bootvec -j .startup -O binary cachetest.elf cachetest.bin
	hexdump -e "1/4 \"%08x\n\"" cachetest.bin -v > cachetest.hex
	cat ../../lib/nops.hex >> cachetest.hex
	
dump:
	$(OBJDUMP) -j .startup.bootvec -j .startup -S -D cachetest.elf -z

symbols:
	$(OBJDUMP) -t cachetest.elf

sections:
	$(OBJDUMP) -h cachetest.elf

clean:
	rm -f cachetest.bin cachetest.elf cachetest.hex cachetest.o
